package com.bobo.web.provider.filter;


import com.bobo.web.api.domain.WxUserDO;

/**
 * WebContext
 * 通过ThreadLocal保存当前登录用户的信息
 *
 * @author:v
 * @version:1.0
 * @date:2018/10/19
 */
public class WebContext {

    private static ThreadLocal<WxUserDO> userContext = new ThreadLocal<>();

    public static void setUserContext(WxUserDO userVO) {
        userContext.set(userVO);
    }

    public static WxUserDO getUserContext() {
        return userContext.get();
    }

    public static void clearUserContext() {
        userContext.remove();
    }
}
